package com.java.service.impl;

import java.util.List;

import com.java.dao.IRoleDao;
import com.java.pojo.ComEmp;
import com.java.pojo.ComRole;
import com.java.service.IRoleService;

public class RoleServiceImpl implements IRoleService{
	private IRoleDao roledao;
	public List<ComRole> getRoleList(int start, int row) {
		
		
		List<ComRole> rlist = roledao.getRoleList(start, row);
		
		
		return rlist;
	}
	public int getRolenum(){
		
		int num = roledao.getRolenum();
		return num;
		
	}
	public String delRoleByIdLog(int[] idlist){
		
		String message = roledao.delRoleById(idlist);	
		
		return message;
	}
	public void setRoledao(IRoleDao roledao) {
		this.roledao = roledao;
	}
	public String addRoleLog(ComRole role) {

		String message=roledao.addRole(role);
		return message;
	}
	
	public ComRole getRoleById(int id){
		
		ComRole role = roledao.getRoleById(id);
		return role;
		
	}
	public String editRoleLog(ComRole role){
		
		String message = roledao.editRole(role);
		return message;
		
		
	}
	
	public String getDeptNameById(int deptno){
		
		String dept = roledao.getDeptNameById(deptno);
		return dept;
	}
	public List<String> getRoleByEmpno(String empno){
		
		List<String> rlist = roledao.getRoleByEmpno(empno);
		return rlist;
	}
	public ComEmp getEmpById(String empno){
		ComEmp emp = roledao.getEmpById(empno);
		return emp;
	}
	public List<ComRole> getRoleByType(int type){
		
		List<ComRole>list = roledao.getRoleByType(type);
		return list;
	}
	public String mappingLog(String empid, int[]type){
		
		String str = roledao.mapping(empid, type);
		return str;
	}
	
	

}
